﻿#ifndef QLYVIDEOREADER_H
#define QLYVIDEOREADER_H

#include "QlyAVFormatContext.h"
#include "QlyAVCodecContext.h"
#include "QlyAVCodec.h"

class QlyVideoReader
{
public:
    QlyVideoReader();
    double frameRate();
    QlyVideoReader(QString fileName);
    bool openFile(QString url);
    bool readFrame(QlyAVFrame &frame);
private:
    QlyAVFormatContext m_videoContext;
    QlyAVCodec m_codec;
    QlyAVCodecContext m_codecContext;
    QString m_fileName;
    QQueue<QlyAVFrame> m_FrameQueue;

    QSet<AVMediaType> m_type;

    int errorcode = 0;
};

#endif // QLYVIDEOREADER_H
